home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / pc / Open Me for REALbasic 3 / REALbasic 3.2 / Goodies / 3rd Party Demos / 3rd Party Plugins / System / LaunchApp Plugin 1.1 / LaunchApp ReadMe < prev   
Encoding:
Text File  |  1999-03-24  |  2.0 KB  |  36 lines

  1.  
  2. LaunchApp(Fat) is a fat (68k and PPC code) plugin for realBASIC 1
  3.  
  4. Why?
  5.  
  6. realBASIC already has a Launch method for FolderItems. The problem is, realBASIC has it’s own idea about what and app is. If it doesn’t think the FolderItem you try to launch is an app, then it won’t launch it. The realBASIC launch method can launch applications and documents, so it has to draw the line somewhere, I suppose.
  7.  
  8. Additionally, using LaunchApplication allows you to control whether the launched application comes to the foreground or remains in the background.
  9.  
  10. I specifically wrote the plugin so that I could launch the Mac OS 8.5 Application Switcher which is an app whose file type is ‘appe’. Other apps of this type include the Control Strip and Print Spoolers. I found 26 ‘appe’ apps on my system.
  11.  
  12. Another possible use is for launching  satellite programs which you don’t want the user to be able to launch manually. You might set the satellite application’s creator and type so that the main application is launched if someone double clicks it, yet you would still be able to launch the satellite application programmatically.
  13.  
  14. LaunchApplication Plugin Function
  15.  
  16. LaunchApplication( theApp as FolderItem, activateFlag as Boolean ) as Boolean
  17.  
  18. Launches a FolderItem. Returns true if successful or false if the launch fails. If the parameter activateFlag equals true then the application will come to the front, if activateFlag equals false the application will launch in the background. 
  19.  
  20. example:
  21.  
  22.     Dim theFile as FolderItem
  23.  
  24.     theFile = GetOpenFolderItem( "any" )  //file type ????/????
  25.  
  26.     //here's the LaunchApplication plugin function
  27.     if not LaunchApplication( theFile, true ) then
  28.  
  29.         //tell the user we failed
  30.         MsgBox "The file didn't launch."
  31.  
  32.     end if
  33.                                                                                                                       
  34. The launchApplication plugin may be freely distributed and used in any way you see fit so long as this document remains unaltered and is distributed with the plugin.
  35.  
  36. Mitch Crane - mcrane@mindspring.com